""" sbak/geometry.py - sbak.geometry - ScrollBack geometric classes

    TODO: `sbak.geometry`
    
    NOTE: The documentation that follows is only a specification of how
    ScrollBack geometry classes should work. At present, however, none
    of what follows has been implemented yet, and this module serves only
    as a placeholder.

    ScrollBack rectangles are instances of either the
    `sbak.geometry.Rect` class or of the `sbak.geometry.FRect` class.
    The Rect class is designed as an enhanced version / replacement of
    the `pygame.Rect` class, fully capable of everything pygame.Rect
    can do, plus more. FRect is an enhanced version of
    `sbak.geometry.Rect`, but uses floating-point values instead of
    integers.
    
    FRect is backwards compatible with Rect (either the sbak or pygame
    versions), but Rect is not entirely forwards compatible with FRect
    because of the loss of information that occurs when floating-point
    values are converted to integers. This is a limitation of
    mathematics rather than a limit of any library used here.
    
    For convenience, both rectangle classes are available as names in
    the base `sbak` module:
    
    
    sbak.Rect -> sbak.geometry.Rect
    sbak.FRect -> sbak.geometry.FRect
    
    
    ~~~ A Note about Implementation ~~~
    
    The classes contained in this module are not actually implemented
    here. Instead, they come from either the `sbak.cgeometry` module or
    the `sbak.pgeometry` module: When `sbak.geometry` is imported, it
    first attempts to import all names from `sbak.cgeometry`, and if
    that fails (meaning the module most likely does not exist in the
    current installation of ScrollBack), then the names are imported
    from `sbak.pgeometry` instead.
    
    The classes in `sbak.cgeometry` and `sbak.pgeometry` are identical
    in the way they function and in their APIs. However, the crect
    versions are implemented with Cython, making them generally faster
    than their prect counterparts. The purpose of the `sbak.geometry`
    module is simply to provide access to the fastest implementation of
    rectangles currently available.
    
    ~~~ Rectangle API ~~~
    
    Due to apparant limitations of pygame.Rect, neither sbak.geometry.Rect
    nor sbak.geometry.FRect are subclasses of pygame.Rect--in other words,
    the classes defined in this module are in no way affected by or
    related to the implementation of the pygame.Rect class. However,
    the developers of ScrollBack strive to make sure that the API of
    ScrollBack's rectangles are compatible with Pygame's, except for
    certain additional methods or properties not provided by Pygame's.
    
    That being said, `sbak.geometry.Rect` and `sbak.geometry.FRect` each
    provide the following properties:
    
    -- Pygame-Compatible Properties --
    
    x               Position of left edge (alias for left)
    y               Position of top edge (alias for top)
    top             Position of top edge (alias for y)
    left            Position of left edge
    bottom          Position of bottom edge
    right           Position of right edge
    topleft         The point located in the top-left corner
    bottomleft      The point located in the bottom-left corner
    topright        The point located in the top-right corner
    bottomright     The point located in the bottom-right corner
    midtop          The point located in the middle of the top edge
    midleft         The point located in the middle of the left edge 
    midbottom       The point located in the middle of the bottom edge
    midright        The point located in the middle of the right edge
    center          The point located in the exact center of the rect
    centerx         The horizontal component of center
    centery         The vertical component of center
    size            The size of the rectangle as a (w,h) tuple
    width           Width of the rect (alias for w)
    height          height of the rect (alias for h)
    w               Width of the rect (alias for width)
    h               Height of the rect (alias for height)
"""

try:
    from sbak.cgeometry import *
except ImportError:
    from sbak.pgeometry import *